interface Person { name: string }
interface Contact { phone: number }

type PersonDetail = Person & Contact & { age: number }

// interface PersonDetail extends Person, Contact {
//   age: number
// }

let obj: PersonDetail = {
  name: 'jack',
  phone: 138888888,
  age: 18
}


// 交叉类型和接口继承的区别
// 接口继承
// interface A {
//   fn: (value:number) => string
// }

// interface B extends A {
//   fn: (value:string) => string
// }

// 交叉类型
interface A {
  fn: (value: number) => string
}

interface B {
  fn: (value: string) => string
}

type C = A & B